import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;


public class Chat{
	
	public static void main(String[] args) {
		
		JFrame frame = new JFrame("MyLocalChat");
		
		JPanel mainPanel = new JPanel();
		frame.getContentPane().add(mainPanel);
		
		ChatMenu menu = new ChatMenu(frame);
		frame.setJMenuBar(menu);
		
		mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
		MessageArea messageAerea = new MessageArea(mainPanel);
		
		InputMessagePanel inputMessage = new InputMessagePanel( mainPanel );
		inputMessage.addObserver( messageAerea );
		
		
		
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		//frame.setSize(600, 600);
		frame.pack();
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		
	}
}
